#include <myheader.h>

/* Usage:  */
int main(int argc, char *argv[]){                                  
    ARGS_CHECK(argc,3);    
     int fd=open(argv[1],O_RDWR); 
    ERROR_CHECK(fd,-1,"open");
    //从fd1读数据
    int fd1=open(argv[2],O_RDWR);
    ERROR_CHECK(fd1,-1,"open");
    
   
    char buf[20]={0};
        while(1){
        read(fd1,buf,sizeof(buf)-1);
        printf("%s\n",buf);
        
        printf("A------\n");
        memset(buf,0,sizeof(buf));
        
        read(0,buf,sizeof(buf)-1);
        write(fd,buf,sizeof(buf));
        memset(buf,0,sizeof(buf));
        }
    
    return 0;
}

